package smb.web;

public class AjaxData {
	public int code = 0;
	public String message = "success";
	public Object data;

	public AjaxData() {
	}

	public AjaxData(int c, Object obj) {
		this.code = c;
		this.data = obj;
	}

	public AjaxData(int c, String msg, Object obj) {
		this.code = c;
		this.message = msg;
		this.data = obj;
	}

	public static AjaxData Error(int code, String message) {
		return new AjaxData(code, message, null);
	}

	public static AjaxData Success() {
		return new AjaxData(0, "success", null);
	}

	public static AjaxData Success(Object data) {
		return new AjaxData(0, "success", data);
	}

	public static AjaxData Success(int code) {
		return new AjaxData(code, "success", null);
	}

	public static AjaxData Success(int code, String message) {
		return new AjaxData(code, message);
	}
}
